#pragma once

#include "RBTree.h"

template<class K>
class Set
{
	struct SetKeyOfT
	{
		const K& operator()(const K& key)
		{
			return key;
		}
	};

public:
	typedef typename RBTree<K, const K, SetKeyOfT>::Iterator iterator;
	typedef typename RBTree<K, const K, SetKeyOfT>::ConstIterator const_iterator;

	iterator begin()
	{
		return _rbtree.Begin();
	}

	iterator end()
	{
		return _rbtree.End();
	}

	const_iterator begin() const
	{
		return _rbtree.Begin();
	}

	const_iterator end() const
	{
		return _rbtree.End();
	}

	pair<iterator, bool> insert(const K& key)
	{
		return _rbtree.Insert(key);
	}

	iterator find(const K& key)
	{
		return _rbtree.Find(key);
	}
private:
	RBTree<K, const K, SetKeyOfT> _rbtree;
};